import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  // 设置路由表
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/Index.vue'),
  },
  {
    path: '/bao',
    name: 'bao',
    component: () => import('../views/bao.vue'),
  },
  {
    path: '/dingdan',
    name: 'dingdan',
    component: () => import('../views/dingdan.vue'),
  },
  {
    path: '/mine',
    name: 'mine',
    component: () => import('../views/mine.vue'),
  },
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '*',
    component: () => import('../views/404.vue'),
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
